import { createStorage } from "./createStorage";
import { generateRandomString } from "./generateRandomString";

export function getDeviceUuid() {
    const config = createStorage()
    if (config.contains(`DEVICE_UUID`)) {
        const device_uuid = config.get(`DEVICE_UUID`)
        if (device_uuid) return device_uuid;
    }
    const deviceUuid = generateRandomString(16)
    config.put(`DEVICE_UUID`, deviceUuid)
    return deviceUuid;
}
